<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="leagal_aid.bean.*,java.util.*,java.io.*" %>
<%
	request.setCharacterEncoding("utf-8");
	String username = request.getParameter("username");
	String phonenumber = request.getParameter("phonenumber");
	String password = request.getParameter("password");
	Admin admin = new Admin();
	if(admin.doLogin(username, password)){
		session.setAttribute("username", username);
		response.sendRedirect("../../backstage.jsp");
	}else if(admin.phoneLogin(username, password)){
		session.setAttribute("phonenumber", username);
		response.sendRedirect("../../backstage.jsp");
	}else{
		response.setCharacterEncoding("utf-8");
		PrintWriter pout = response.getWriter();
		pout.print("<script>alert('账号密码错误'); window.location='../../login.jsp' </script>");
		pout.flush();
		pout.close();
		//response.sendRedirect("login.html");
	};

%>